using System;
using Castle.ActiveRecord;
using System.Collections.Generic;

namespace EYDIngenieria.ERP.ObjetosDeNegocio.Dominio
{
    [ActiveRecord]
    public class Voucher:ActiveRecordBase<Voucher>
    {
        private int id;
        private int idvoucher;
        private DateTime fecha;
        private PlanDeCuenta cuenta;
        private double debe;
        private double haber;
        private string glosa;

        public Voucher(int id, int idvoucher, DateTime fecha, PlanDeCuenta cuenta, double debe, double haber, string glosa)
        {
            this.id = id;
            this.fecha = fecha;
            this.idvoucher = idvoucher;
            this.cuenta = cuenta;
            this.debe = debe;
            this.haber = haber;
            this.glosa = glosa;
        }

        public Voucher(): this(0, 0, DateTime.Now, new PlanDeCuenta(), 0, 0, string.Empty)
        {
        }
        
        [PrimaryKey(PrimaryKeyType.Native)]
        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        [Property]
        public DateTime Fecha
        {
            get { return fecha; }
            set { fecha = value; }
        }

        [Property]
        public int IdVoucher
        {
            get { return idvoucher; }
            set { idvoucher = value; }
        }

        [BelongsTo("IdCuenta")]
        public PlanDeCuenta Cuenta
        {
            get { return cuenta; }
            set { cuenta = value; }
        }

        [Property]
        public double Debe
        {
            get
            {
                return debe;
            }
            set { debe = value; }
        }

        [Property]
        public double Haber
        {
            get
            {
                return haber;
            }
            set { haber = value; }
        }

        [Property]
        public string Glosa
        {
            get
            {
                return glosa;
            }
            set { glosa = value; }
        }
        
    }
}
